//
//  HomeLabel.m
//  JZMCFM
//
//  Created by Mc on 15/10/30.
//  Copyright (c) 2015年 陈卓. All rights reserved.
//

#import "HomeLabel.h"

@implementation HomeLabel

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.textAlignment = NSTextAlignmentCenter;
        self.font = [UIFont systemFontOfSize:17];
        self.userInteractionEnabled = YES;
        self.scale = 0.0;
    }
    return self;
}

- (void)setScale:(CGFloat)scale
{
    _scale = scale;
    
    // 颜色渐变
    self.textColor = [UIColor colorWithRed:scale green:0 blue:0 alpha:1.0];
    
    // 大小渐变
    CGFloat minWhScale = 0.9;
    CGFloat whScale = minWhScale + scale * (1 - minWhScale);
    self.transform = CGAffineTransformMakeScale(whScale, whScale);
}

@end
